<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ page contentType="text/html; charset=utf-8"  import="com.leexuan.ordersystem.beans.*" import="java.util.*"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK 
href="css/admincp.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript src="script/common.js"></SCRIPT>

<SCRIPT src="script/iframe.js" type=text/javascript></SCRIPT>

  
<html:base/></HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD>产品管理&nbsp;>>&nbsp;产品查询结果</TD></TR></TBODY></TABLE><BR>

      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" 
border=0>
        <TBODY>
        <TR class=header>
          <TD width="10%">产品编号</TD>
          <TD width="15%">产品名称</TD>
          <TD width="15%">产品型号</TD>
          <TD width="10%">分类</TD>
          <TD width="10%">库存数量</TD>
          <TD width="10%">单价</TD>         
          <TD width="20%">操作</TD></TR>
<%

ArrayList arraylist =new ArrayList();
arraylist = (ArrayList)session.getAttribute("products");

Product[] products = new Product[arraylist.size()];
arraylist.toArray(products);

for(int i =0;i<products.length;i++){
%>              
        <TR align=middle>
          <TD class=altbg1><%=products[i].getNumber()%></TD>
          <TD class=altbg2><%=products[i].getName() %></TD>
          <TD class=altbg1><%=products[i].getModel() %></TD>
          <TD class=altbg2><%=products[i].getSname() %></TD>
          <TD class=altbg1><%=products[i].getNum() %></TD>
          <TD class=altbg2><%=products[i].getPrice() %> 元</TD>
          <TD class=altbg1>
          <a href="editProduct.do?pid=<%=products[i].getPid() %>" target="main">编辑</a>
          	<a href="delProduct.do?pid=<%=products[i].getPid() %>" target="main" onclick="return window.confirm('你确定要删除吗?');">删除</a>
          </TD>

          </TR>
          
          

<% }
if(products.length ==0){
%>
<TR><TD colSpan=7><center><font color="red">抱歉：没有找到符合搜索条件的产品！</font></center></TD></TR>
<%
}else{
%>
<TR><TD colSpan=7><center><font color="red">搜索结果：共找到<%=products.length %>件符合条件的产品！</font></center></TD></TR>	
<%	
}
session.removeAttribute("products");
%>


</TBODY></TABLE>
     <CENTER>
      <br><INPUT class=button type=button value="继续查询" onclick="window.location.href='searchProduct.jsp';">
      </CENTER>

</TD></TR></TBODY></TABLE>

<%@include file= "./footer.jsp"%>
